package com.liyuxiang.feign;

import com.liyuxiang.feign.service.DeptService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * @Author: liyuxiang
 * @Date: 2025/8/21 10:17
 * @Description: TODO
 */
@SpringBootApplication
@EnableFeignClients(basePackages = "com.liyuxiang.feign")
@EnableDiscoveryClient
public class McpApplication {
    public static void main(String[] args) {
        SpringApplication.run(McpApplication.class, args);
    }

    @Bean
    public ToolCallbackProvider deptServiceTools(DeptService deptService) {
        return MethodToolCallbackProvider.builder().toolObjects(deptService).build();
    }
}
